package com.bnz.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Data // 添加get，set，toString方法
// 在配置文件在加了@EnableConfigurationProperties({HelloProperties.class})，不用加@Component注入spring容器
@ConfigurationProperties(prefix = "my0710") // 获取前缀为my0710的配置文件信息
public class HelloProperties {

    private String name = "王二";
    private Integer age = 50;

}
